<?php

include("classes/include.php");

session_start();

if(isset($_GET['action']))
{
	if($_GET['action'] == "deco")
	{
		session_destroy();
	}
}

if(isset($_POST['id_id']) && isset($_POST['id_ps']))
{

	$login = $_POST['id_id'];
	$mdp = $_POST['id_ps'];

	//$utilisateur = new Etudiant();

	$mess = Utilisateur::identifierInternaute($login,$mdp);
}
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>ActuStage</title>
	<link href="css/style.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="javascript/tiny_mce/tiny_mce.js"></script>
	
	<script type="text/javascript">
	tinyMCE.init({
	        // General options
	        mode : "textareas",
	        theme : "advanced",
	        plugins : "autolink,lists,spellchecker,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

	        // Theme options
	        theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",
	        theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
	        theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
	        theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",
	        theme_advanced_toolbar_location : "top",
	        theme_advanced_toolbar_align : "left",
	        theme_advanced_statusbar_location : "bottom",
	        theme_advanced_resizing : true,

	        // Skin options
	        skin : "o2k7",
	        skin_variant : "silver",

	        // Example content CSS (should be your site CSS)
	        content_css : "css/example.css",

	        // Drop lists for link/image/media/template dialogs
	        template_external_list_url : "js/template_list.js",
	        external_link_list_url : "js/link_list.js",
	        external_image_list_url : "js/image_list.js",
	        media_external_list_url : "js/media_list.js",

	        // Replace values for the template plugin
	        template_replace_values : {
	                username : "Some User",
	                staffid : "991234"
	        }
	});
	</script>

</head>

<body>


	<div id="container">
		<div id="bandeau">
			<a href="index.php"><img src="images/banniere.jpg" width="906" height="110" alt="" /></a> 
         
            <div id="adh">
               <?php 
             	if(!isset($_SESSION['utilisateur']))
            	{
					?>
				<form action="contacts.php" method="post">
                <span style="font-variant: small-caps;color:#FFF;margin-right:5px;font-size:9pt;"> Espace utilisateur</span>
					<input id="identifiant" name="id_id" class="input" value="Nom d'utilisateur" onClick="effacerid();" onblur="remplirid();" style="height:10px;font-size:8pt;" />
					<input id="mot_de_passe" name="id_ps" type="password" value="Mot de passe" onClick="effacermdp();" onblur="remplirmdp();" class="input" style="height:10px;font-size:8pt;" />
					<input type="submit" value="ok" style="font-size:8pt;" alt="" />
				</form>
				<script type="text/javascript">
					function effacerid(){
						document.getElementById( 'identifiant' ).value = "" ;
					}
					function effacermdp(){
						document.getElementById( 'mot_de_passe' ).value = "" ;
					}
					function remplirid(){
						if (!document.getElementById( 'identifiant' ).value){
							document.getElementById( 'identifiant' ).value = "Nom d'utilisateur";}
					}
					function remplirmdp(){
						if (!document.getElementById( 'mot_de_passe' ).value ){
							document.getElementById( 'mot_de_passe' ).value = "Mot de passe" ;}
					}
	
				
				</script>
                    <?php
				}
				else
				if(isset($_SESSION['utilisateur']))
            	{
					$nom = $_SESSION['utilisateur']->getNomUtilisateur();
					$prenom = $_SESSION['utilisateur']->getPrenomUtilisateur();
					?>
					<span style="font-variant: normal-caps;color:#FFF;margin-right:232px;font-size:10pt;"><?php echo 'Bienvenue ', $prenom,' ', $nom; ?></span>
                    <?php                   
				}
			?>
			</div>
        
		</div>
    	<div class="clear"></div>
      <?php   
    include("menu.php");
    ?>
		<div id="contenu">
			<div id="texteaccueil">
         		<div id="titreAcceuil">
       				 <h2>Gestion de la page Contacts <br /> <img src="images/traitBleu.png"width="700" height="3" alt="" /></h2>
       			</div>
        <div id="texte" align="center">
        
        
        
        
        <form method="post" action="executeTexte.php">
        <p>     
                <textarea name="content" >
                
                      <?php
        $requeteTexte = new RequeteSQL("select tex_texte from texte  where tex_type='contact' ");   
$requeteTexte->executeQuery();
$affichage = $requeteTexte->fetch();

 echo       stripslashes($affichage['tex_texte']);
         ?>
                
                </textarea>
                </br>
                <input type="submit" name='saveContact' value="Sauvegarder" />
        </p>
</form>
        
        
        
        
        
        </div>    
 		    <div class="clear">
            </div>
          <div id="bas">
    				Universit&eacute; d'Evry-Val-d'Essonne Boulevard Fran&ccedil;ois Mitterrand 91025 Evry Cedex <br /> <a href="contacts.php">Contacts</a>|<a href="planSite.php">Plan du site</a>|<a href="informationsLegales.php">Informations l&eacute;gales</a> 
  				</div>
			</div>
		</div>
		<div class="clear"></div>
    	<div class="clear"></div>
	</div>
</body>
</html>
         	<script type="text/javascript">
			function menu(){
				
				document.getElementById('sub').style.display = 'block';
			
			}
			function sortie(){
				
				document.getElementById('sub').style.display = 'none';
			
			}
				
				</script>
